using System.Collections.Generic;

namespace Samurai.DAL
{
    public class GenreImageProvider
    {
        private Dictionary<string, string> _genreImageDictionary;

        private GenreImageProvider()
        {
            _genreImageDictionary = new Dictionary<string, string>()
                                        {
                                            {"DRAMA", "pack://application:,,,/Samurai.Client;component/Images/drama_32x32.png"},
                                            {"HORROR", "pack://application:,,,/Samurai.Client;component/Images/horror_48x48.gif"},
                                            {"SCI-FI", "pack://application:,,,/Samurai.Client;component/Images/scifi_48x48.gif"},
                                            {"MYSTERY", "pack://application:,,,/Samurai.Client;component/Images/mystery_48x48.gif"},
                                            {"COMEDY", "pack://application:,,,/Samurai.Client;component/Images/comedy_48x48.gif"},
                                            {"ANIMATION", "pack://application:,,,/Samurai.Client;component/Images/animation_48x48.gif"},
                                            {"ADVENTURE", "pack://application:,,,/Samurai.Client;component/Images/adventure_48x48.gif"},
                                            {"WAR", "pack://application:,,,/Samurai.Client;component/Images/war_48x48.gif"},
                                            {"HISTORY", "pack://application:,,,/Samurai.Client;component/Images/history_48x48.gif"},
                                            {"ROMANCE", "pack://application:,,,/Samurai.Client;component/Images/romance_48x48.png"},
                                            {"FAMILY", "pack://application:,,,/Samurai.Client;component/Images/family_48x48.png"}
                                        };
        }

        public string GetImageLink(string title)
        {
            if (_genreImageDictionary.ContainsKey(title.ToUpper()))
            {
                return _genreImageDictionary[title.ToUpper()];
            }

            return "pack://application:,,,/Samurai.Client;component/Images/unknown_48x48.gif";
        }

        private static GenreImageProvider _instance;
        public static GenreImageProvider Instance
        {
            get
            {
                if (_instance == null)
                    _instance = new GenreImageProvider();
                return _instance;
            }
        }
    }
}